<template>
  <div class="machine_container">
    <el-table
      :data="tableDataAndTypes.tableAllData"
      style="width: 100%; height: 100%"
      :header-cell-style="getRowClass"
      :row-style="{ fontSize: '10px', height: '5px' }"
      :cell-style="{ padding: '0' }">
      <el-table-column
        v-for="(item, index) in tableDataAndTypes.formHead"
        :key="index"
        align="center"
        :prop="Object.values(item)[0]">
        <template slot="header">
          <div>{{Object.keys(item)[0]}}</div>
        </template>
      </el-table-column>
      <el-table-column
        label="查询"
        align="center">
        <template slot-scope="scope">
          <el-button type="text" size="small" @click="checkedNum(scope.row)">剪料数</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: 'tables',
  data () {
    return {
    }
  },
  props: {
    tableDataAndTypes: {
      type: Object,
      required: true
    }
  },
  computed: {
    trunEnter () {
      return function (item) { // 正则匹配 \ 然后变成换行符
        // return `${item}`\\\\
      }
    }
  },
  created () {
  },
  mounted () {
  },
  methods: {
    getRowClass ({ row, column, rowIndex, columnIndex }) {
      if (rowIndex === 0) {
        return 'background: rgb(48,52,61);color: rgb(221,224,232);font-weight: unset;font-size: 8px'
      } else {
        return ''
      }
    },
    checkedNum () {}
  }
}
</script>

